﻿/***********************************************************************************************
 * 
 * ProjectName: WMSSoft.WinKStart
 * 
 * Description: Panel to use in Pages to add ListItems  
 * 
 * Created:     31.10.2012
 * 
 * Author:      matthias wagler - matthias@WMSSoft.de
 * 
 * Copyright:   Copyright 2012 by WMSSoft.de
 * 
 * License:     GPLv3
 * 
 * History:     31.10.2012 - matthias wagler matthias@WMSSoft.de   -   Created
 * 
 **********************************************************************************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using WMSSoft.Lib.Basic;
using WMSSoft.Lib.Enums;

namespace WMSSoft.WinKStart
{
    /// <summary>
    /// Interaktionslogik für MinimizeablePanel.xaml
    /// </summary>
    public partial class MinimizeablePanel : UserControl
    {
        private Int32 _Headerheight = 20;
        private Int32 _ContentItemsHeight = 40;
        private Int32 _VisibleItems = 5;
        private string _Caption = "MinimizeablePanel";


        public MinimizeablePanel ()
        {
            InitializeComponent();
            lblPanelCaption.Background = null;
        }

        #region Properties

        public Int32 ContentItemheight
        {
            get { return _ContentItemsHeight; }
            set 
            { 
                _ContentItemsHeight = value;                
            }
        }

        public string Caption
        {
            get { return _Caption; }
            set
            {
                _Caption = value;
                lblPanelCaption.Content = _Caption;
            }
        }

        public object CaptionContent
        {
            get { return lblPanelCaption.Content; }
            set { lblPanelCaption.Content = value; }
        }

        public System.Windows.Controls.ListBox ListContent
        {
            get { return lbContentList; }
        }

        public System.Windows.Controls.Label Header
        {
            get { return lblPanelCaption; }
        }

        #endregion

        private void grdMain_SizeChanged(object sender, SizeChangedEventArgs e)
        {
            lbContentList.Width = this.Width;
            lbContentList.Height = this.Height - (lblPanelCaption.Height + lblPanelCaption.Margin.Top + lblPanelCaption.Margin.Bottom);
        }
    }
}
